package com.spar.openprojects.shared;

import java.util.ArrayList;
import java.util.List;

import com.google.gwt.user.client.rpc.IsSerializable;

public class OrderExcel implements IsSerializable {
	private Project project;
	private BusinessPartner businessPartner = new BusinessPartner();

	private OrderItem offer = new OrderItem();
	private OrderItem order = new OrderItem();

	private List<OrderItem> bills = new ArrayList<OrderItem>();

	private String signature1;
	private String signature2;

	public OrderItem getOffer() {
		return offer;
	}

	public void setOffer(OrderItem offer) {
		this.offer = offer;
	}

	public OrderItem getOrder() {
		return order;
	}

	public void setOrder(OrderItem order) {
		this.order = order;
	}

	public List<OrderItem> getBills() {
		return bills;
	}

	public void setBills(List<OrderItem> bills) {
		this.bills = bills;
	}

	public BusinessPartner getBusinessPartner() {
		return businessPartner;
	}

	public void setBusinessPartner(BusinessPartner businessPartner) {
		this.businessPartner = businessPartner;
	}

	public Double getBillAmount() {
		Double amount = 0D;
		for (OrderItem bill : bills) {
			if (bill.getAmount() != null)
				amount += bill.getAmount();
		}
		return amount;
	}

	public void persist() {

	}

	public Project getProject() {
		return project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	public String getSignature1() {
		return signature1;
	}

	public void setSignature1(String signature1) {
		this.signature1 = signature1;
	}

	public String getSignature2() {
		return signature2;
	}

	public void setSignature2(String signature2) {
		this.signature2 = signature2;
	}

}
